#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QMimeData>
#include <QDragEnterEvent>
#include <QList>
#include <QPaintEvent>
#include <QPainter>
#include <QUrl>
#include <QDropEvent>
#include <QFileDialog>
#include <QMessageBox>
#include <QList>
#include <QStringList>
#include <QSharedPointer>
#include <QIcon>
#include <QThread>
#include <QFileInfo>
#include <QProcess>
// #include <QDebug>


QT_BEGIN_NAMESPACE
namespace Ui {
class QtToolWidget;
}
QT_END_NAMESPACE

class ConversionObject;

class QtToolWidget : public QWidget
{
    Q_OBJECT
public:
    QtToolWidget(QWidget *parent = nullptr);
    ~QtToolWidget();

protected:
    void dragEnterEvent(QDragEnterEvent *event) override; //拖入事件
    void dropEvent(QDropEvent *event) override;           //拖入后松开事件
    void paintEvent(QPaintEvent* event)override;

private slots:
    void selectUiFileManually();//手动选择文件
    void conversion(const QSharedPointer<QList<QSharedPointer<QStringList>>>& startupArguments);//转换文件函数
    void conversionFinished( QThread * const conversionThread,ConversionObject * const conversionObj);//转换结束函数，释放线程对象和转换对象

    void generateStartupArguments(const QSharedPointer<QList<QSharedPointer<QFileInfo>>>& fileInfos);//根据文件信息列表生成启动参数列表
signals:
    void FileInfos(const QSharedPointer<QList<QSharedPointer<QFileInfo>>>&);//发送处理后的文件路径List
    void StartupArguments(const QSharedPointer<QList<QSharedPointer<QStringList>>>&);//发送启动参数列表

private:
    Ui::QtToolWidget *ui;
    QString uicPath;
    QString savePath;
};

#endif // WIDGET_H
